#include <cc++/socket.h>
#include <string>

using namespace std;
using namespace ost;

void Test(string ip, int port)
{
    InetAddress ia(ip.c_str());
    TCPSocket s(ia, port);

    s.isPendingConnection();
    cout << "Connection established" << endl;

    TCPStream ts(s);
    
    cout << "Begin send data" << endl;

    while(1)
    {
	char buf[1024];
        ts.write(buf, 1024);
	cout << "send out" << endl;
    }
}

int main()
{
    Test("127.0.0.1", 12812);

    return 0;
}

